@import "@stackstorm/st2-style/colors.css";

.st2-auto-form {
  position: relative;

  &__line {
    position: relative;

    &:last-of-type {
      border-bottom: 0;
    }
  }

  &__label {
    display: block;

    margin-bottom: 12px;
  }

  &__title {
    font-size: 15px;
    line-height: 18px;

    padding-bottom: 8px;

    white-space: nowrap;
  }

  &__error {
    line-height: 18px;

    position: absolute;
    top: 0;
    right: 0;

    color: var(--red-darken-2);
  }

  &__type {
    font-size: 18px;
    font-weight: normal;
    line-height: 38px;

    position: absolute;
    right: 0;

    width: 36px;
    height: 36px;

    user-select: none;
    text-align: center;

    color: var(--grey-base);
  }

  &__button {
    font-size: 14px;
    line-height: 34px;

    position: absolute;
    right: 0;

    width: 36px;
    height: 36px;

    cursor: pointer;
    user-select: none;
    text-align: center;

    &:hover {
      color: var(--aqua-base);
    }
  }

  &__field {
    font-weight: normal;
    font-family: Roboto, sans-serif;
    -webkit-box-sizing: border-box;
       -moz-box-sizing: border-box;
            box-sizing: border-box;
    width: 100%;
    height: 36px;
    padding: 0 12px;

    color: black;
    border: none;
    outline: 0;
    background-color: white;
    box-shadow: 0 1px 0 var(--grey-lighten-2);

    &&[disabled] {
      cursor: default;

      color: black;
      border-color: transparent;
      background-color: var(--grey-lighten-4);
    }

    &::placeholder {
      color: var(--grey-lighten-3);
    }

    &:invalid {
      box-shadow: none;
    }

    &:focus {
      box-shadow: 0 1px 0 var(--aqua-base);
    }

    &--invalid,
    &--invalid:focus,
    &.ng-dirty.ng-invalid,
    &.ng-touched.ng-invalid {
      box-shadow: 0 1px 0 var(--red-darken-2);
    }

    option {
      color: black;
    }
  }

  &__value {
    font-weight: normal;

    -webkit-box-sizing: border-box;
       -moz-box-sizing: border-box;
            box-sizing: border-box;
    width: 100%;
    height: 36px;
    padding: 0 12px;

    cursor: default;

    color: black;
    background-color: var(--grey-lighten-4);
    box-shadow: 0 1px 0 var(--grey-lighten-2);
  }

  &__text,
  &__link {
    line-height: 36px;

    color: black;
  }

  &__text-field &__field {
    font-size: 13px;
    line-height: 18px;

    display: block;
    overflow-x: hidden;
    overflow-y: scroll;

    padding: 9px 12px;

    resize: none;
    cursor: text;
    word-wrap: break-word;
    max-height:50px;
    &::-webkit-scrollbar {
      width: 13px;
      height: 13px;

      background-color: transparent;
    }

    &::-webkit-scrollbar-thumb {
      border: 4px solid rgba(0, 0, 0, 0);
      border-radius: 11px;
      background-color: rgba(117, 117, 117, .3);
      background-clip: padding-box;

      &:hover {
        background-color: rgba(117, 117, 117, .7);
      }
    }
       &-color-block {
      width: 1em;
      position: absolute;
      left: 5px;
      top: 9px;
    }

    &-options {
      position: absolute;
      background-color: white;
      z-index: 1;

      &-menu {
        display: flex;
        flex-flow: row wrap;
        align-items: flex-start;
        width: 140px;

        &-item {
          flex-basis: 25%;
          text-align: center;
          margin-bottom: 5px;
          max-width: 35px;

          &-button {
            width: 25px;
            height: 25px;
            border-radius: 0;
            padding: 5px;
            border: none;

            &:hover {
              border: 1px solid gray;
            }
          }
        }
      }
    }
  }

  &__field-clone {
    position: absolute;
    z-index: -1;

    visibility: hidden;
    overflow: hidden;

    height: 0 !important;
    min-height: 0 !important;

    word-wrap: break-word;

    border: 0;
  }

  &__select {
    position: relative;

    &:after {
      font-family: "brocadeicons";
      font-size: 18px;
      font-weight: normal;
      font-style: normal;
      line-height: 36px;

      position: absolute;
      right: 0;
      bottom: 0;

      display: block;

      padding: 0 10px 0 0;

      content: "\e91c";
      vertical-align: middle;
      pointer-events: none;

      color: black;
    }
  }

  &__select &__field {
    padding-right: 30px;

    border-radius: 0;

    -webkit-appearance: none;
       -moz-appearance: none;

    &:-moz-focusring {
      color: transparent;
      /* an actual text color for firefox */
      /* see https://stackoverflow.com/a/11603104 */
      text-shadow: 0 0 0 black;
    }
  }

  &__checkbox {
    display: none;

    margin: 0;
    padding: 0;

    &-block {
      font-size: 15px;
      line-height: 36px;
    }

    &-label {
      font-weight: 100;

      cursor: pointer;
      user-select: none;
      vertical-align: top;
    }

    & + &-label:before {
      font-family: "brocadeicons";
      font-size: 12px;
      font-weight: normal;
      font-style: normal;
      line-height: 10px;

      display: inline-block;

      width: 10px;
      height: 10px;
      margin-right: .3em;

      content: "\e968";
      text-decoration: inherit;

      color: var(--aqua-base);
      border: 1px solid black;
      background-color: transparent;
      text-shadow: 1px 0 0 #eee, 0 -1px 0 #eee;
    }

    &:not(:checked) + &-label:before {
      color: transparent;
      text-shadow: none;
    }

    &--default:not(:checked) + &-label:before {
      color: var(--grey-lighten-2);
      text-shadow: 1px 0 0 #eee, 0 -1px 0 #eee;
    }

    &[disabled] + &-label:before {
      border: 1px solid var(--grey-lighten-3);
    }
  }

  &__description {
    margin-top: -5px;
    white-space: pre-wrap;
    opacity: .7;
    color: var(--grey-darken-1);
  }

  &__suggestions {
    position: absolute;
    z-index: 1;

    box-sizing: border-box;
    width: 100%;
    margin-top: -16px;

    user-select: none;

    background-color: white;
    box-shadow: rgba(0, 0, 0, .2) 0 8px 18px 0,
    rgba(0, 0, 0, .2) 0 8px 20px 0;
  }

  &__suggestion {
    box-sizing: border-box;
    width: 100%;
    padding: 5px 10px;

    cursor: pointer;

    &--active {
      color: var(--aqua-base);
    }

    &--selected {
      background-color: var(--aqua-lighten-5);
    }

    &:hover {
      background-color: var(--yellow-lighten-5);
    }

    &-primary {
      font-size: 14px;
    }

    &-secondary {
      font-size: 10px;

      color: black;
    }
  }

  &--flat & {
    &__label {
      display: flex;
    }

    &-text {
      display: flex;

      margin-bottom: 12px;
    }

    &__text-field {
      display: flex;
    }

    &__title {
      font-size: inherit;
      width: 120px;

      padding: 0;
    }

    &__field,
    &__field[disabled] {
      background-color: transparent;
      box-shadow: none;

      height: auto;
      width: auto;

      flex: 1;

      padding: 0;
    }

    &__value {
      background-color: transparent;
      box-shadow: none;

      height: auto;
      width: auto;

      flex: 1;

      padding: 0;
    }

    &__text,
    &__link {
      line-height: inherit;
    }

    &__link {
      color: var(--selected);
    }

    &__checkbox {
      &-block {
        font-size: inherit;
        line-height: initial;
      }

      &-label {
        width: 120px;
        display: inline-block;
        position: relative;

        &:before {
          display: none;
        }

        &:after {
          content: "no";
          position: absolute;
          left: 100%;
        }
      }
    }
    
    &__description {
      display: none;
    }

    &__select {
      &:after {
        display: none;
      }
    }
  }
}

.st2-manual-form {
  position: relative;
}
.icon-T {
  &:before {
    content: 'T';
    font-family: Garamond, Georgia, Times New Roman, serif !important;;
  }
}

.tooltiptext {
  visibility: hidden;
} 
.showtooltiptext {
   visibility: visible; 
   width: auto;
   padding: 0;
   color: #6c6c6c;
   background: none;
   display: inline-block;
   margin-top: 4px;
   margin-left: 35px;
} 

